IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spArchives_Update')
	BEGIN
		PRINT 'Dropping Procedure spArchives_Update'
		DROP  Procedure  spArchives_Update
	END

GO

PRINT 'Creating Procedure spArchives_Update'
GO
Create Procedure dbo.spArchives_Update
	( 	  
		@Archive_ID int, 
		@CreatedByUser_ID numeric(9,0) = null, 
		@ArchiveDate DateTime = null, 
		@ArchiveStatus varchar(50) = null, 
		@DivisionName varchar(50) = null, 
		@DepartmentName varchar(50) = null, 
		@AttachedFile image = null, 
		@Comments varchar(250) = null, 
		@DestructionDate DateTime = null, 
		@Shred bit = null, 
		@NoShredReason varchar(100) = null, 
		@CurrentLocation varchar(100) = null, 
		@DeliveryCollection varchar(100) = null, 
		@DueDate DateTime = null, 
		@ApprovedUser_ID numeric(9,0) = null, 
		@ApprovedDate DateTime = null, 
		@ReceivedbyUser_ID numeric(9,0) = null, 
		@ReceivedDate DateTime = null, 
		@ClosedByUser_ID numeric(9,0) = null, 
		@ClosedDate DateTime = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 2007/11/02    Initial version Updated
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Update the required new record
	UPDATE Archives
	SET
		CreatedByUser_ID = @CreatedByUser_ID, 
		ArchiveDate = @ArchiveDate, 
		ArchiveStatus = @ArchiveStatus, 
		DivisionName = @DivisionName, 
		DepartmentName = @DepartmentName, 
		AttachedFile = @AttachedFile, 
		Comments = @Comments, 
		DestructionDate = @DestructionDate, 
		Shred = @Shred, 
		NoShredReason = @NoShredReason, 
		CurrentLocation = @CurrentLocation, 
		DeliveryCollection = @DeliveryCollection, 
		DueDate = @DueDate, 
		ApprovedUser_ID = @ApprovedUser_ID, 
		ApprovedDate = @ApprovedDate, 
		ReceivedbyUser_ID = @ReceivedbyUser_ID, 
		ReceivedDate = @ReceivedDate, 
		ClosedByUser_ID = @ClosedByUser_ID, 
		ClosedDate = @ClosedDate		
	WHERE Archive_ID = @Archive_ID

	-- Return to calling method
	RETURN
	
GO
